export default function macReducer(state = {
        userInfo: {firstName: "", lastName: "", policyNum: "" },
        error: null,
        verifying: null}, action) {
    switch (action.type) {
        case 'typing':
            const field = action.payload.field;
            const value = action.payload.value;
            state.userInfo[field] = value;
            return state;
        case 'verify-fail':
            return {
                ...state,
                error: "something going wrong",
                verifying: null
            }
        case 'verifying':
            return {
                ...state,
                verifying: action.payload
            }
        default:
            return state;
    }
}

